package com.hqd.ch03.v22.aop.framework;

public class ProxyFactory extends AdvisedSupport {
    private AopProxyFactory aopProxyFactory = new DefaultAopProxyFactory();

    public ProxyFactory(Object target) {
        super(target);
    }

    public Object getProxy() {
        return createAopProxy().getProxy();
    }

    protected final synchronized AopProxy createAopProxy() {
        return aopProxyFactory.createAopProxy(this);
    }

    public void setAopProxyFactory(AopProxyFactory aopProxyFactory) {
        this.aopProxyFactory = aopProxyFactory;
    }
}
